﻿@model S4Store.Models.CarSchedule.InputDataModel
@{
    ViewBag.Title = "InputData";
    Layout = null;
}
<style type="text/css">
.reporttable1 td,.reporttable1 th
{
    padding:5px;
    border:0.5pt solid windowtext;
    vertical-align:middle
}
.reporttable1 th
{
    text-align:center;
    background:aqua
}
.reporttable1 th div
{
    display:inline-block; 
    margin:5px
}
</style>
<div class="verticalSplitContainer" style="height:100%;width:100%; overflow:hidden">
<div style="width:100%; height:30px; background:#E5EDEF" ratio="#30">
    <div style=" padding:5px 10px">
        <form action="@Url.Action("InputData", "CarSchedule")">
        <select class="storechooser" name="Month">
            @for (DateTime dt=DateTime.Now;dt>DateTime.Now.AddYears(-1);dt=dt.AddMonths(-1))
            {
                <option  value="@dt.ToString("yyyy-MM-01")" @if (dt.Year == Model.Month.Year&&dt.Month==Model.Month.Month)
                                                            {<text>selected="selected"</text>}>@dt.ToString("yyyy-MM")</option>
            }
        </select>
        </form>
    </div>
</div>
<form  class="verticalSplitContainer addpage" action="@Url.Action("Add")" method="post" ratio="*" style="width:100%; overflow:auto">
<div style="width:100%; overflow:auto" ratio="*">
<table  style="border-collapse:collapse;" class="reporttable1">
    <tr><input type="hidden" name="MonthCarSale.Month" value="@Model.Month.ToString("yyyy-MM-dd")" />
      <th><div>上月成交率：</div></th>
      <td><input type="text" name="MonthCarSale.LastMonthVr" value="@Model.MonthCarSale.LastMonthVr.toInt()" class="w20 ipt" />%</td>
      <th>目标订单量</th>
      <td><input type="text" name="MonthCarSale.TargetOrderCount" value="@Model.MonthCarSale.TargetOrderCount" class="w20 ipt" /></td>
      <th>上月订交转化率</th>
      <td><input type="text" name="MonthCarSale.LastMonthOrderTransformRate" value="@Model.MonthCarSale.LastMonthOrderTransformRate.toInt()" class="w20 ipt" />%</td>
      <th>精装车销售率目标</th>
      <td><input type="text" name="MonthCarSale.HardcoverCarTarget" value="@Model.MonthCarSale.HardcoverCarTarget.toInt()" class="w20 ipt" />%</td>
      <th>保险目标</th>
      <td><input type="text" name="MonthCarSale.InsureTarget" value="@Model.MonthCarSale.InsureTarget.toInt()" class="w20 ipt" />%</td>
      <th>置换目标</th>
      <td><input type="text" name="MonthCarSale.ReplacementTarget" value="@Model.MonthCarSale.ReplacementTarget.toInt()" class="w20 ipt" />%</td>
      <th>金融目标</th>
      <td><input type="text" name="MonthCarSale.FinancialTarget" value="@Model.MonthCarSale.FinancialTarget.toInt()" class="w20 ipt" />%</td>
      <th>延保目标</th>
      <td><input type="text" name="MonthCarSale.ExtendTarget" value="@Model.MonthCarSale.ExtendTarget.toInt()" class="w20 ipt" />%</td>
     </tr>
</table>
<table  style="border-collapse:collapse;" class="reporttable1">
 <tbody>
 
 <tr>
  <th rowspan="4" colspan="2">项目数据</th>
  <th rowspan="4">是否售卖</th>
  <th rowspan="4">月初库存</th>
  <th rowspan="4">上月交车</th>
  <th rowspan="2" colspan="3">订车</th>
  <th rowspan="2" colspan="5">库存</th>
  <th rowspan="2" colspan="2">交车</th>
  <th rowspan="4">销售目标</td>
  <th rowspan="2" colspan="3">有望客户数</th>
  <th rowspan="2" colspan="3">登记客户数</th>
  <th rowspan="2" colspan="4">精装车销售</th>
  <th rowspan="2">保险目标</th>
  <th rowspan="2">置换目标</th>
  <th rowspan="2">金融目标</th>
  <th rowspan="2">延保目标</th>
 </tr>
 <tr>
 </tr>
 <tr>
  <th rowspan="2">上月未交</th>
  <th colspan="2">本月已定</th>
  <th rowspan="2">A类</th>
  <th rowspan="2">B类</th>
  <th rowspan="2">C类</th>
  <th rowspan="2">C类库龄</th>
  <th rowspan="2">本月预提</th>
  <th colspan="2">本月已交</th>
  <th rowspan="2">H级</th>
  <th rowspan="2">A级</th>
  <th rowspan="2">B级</th>
  <th rowspan="2">H级</th>
  <th rowspan="2">A级</th>
  <th rowspan="2">B级</th>
  <th rowspan="2">A套餐</th>
  <th rowspan="2">B套餐</th>
  <th rowspan="2">C套餐</th>
  <th rowspan="2">其他</th>
  <th rowspan="2">本月已投</th>
  <th rowspan="2">本月已换</th>
  <th rowspan="2">本月已做</th>
  <th rowspan="2">本月已做</th>
 </tr>
 <tr>
  <th>二网</th>
  <th>本店</th>
  <th>二网</th>
  <th>本店</th>
 </tr>
 @{int i = 0;}
 @foreach (var branddata in Model.getBrandData())
 {
     int index = 0;
     foreach (var m in branddata.MonthCarModelSales)
     {
        <tr>
         @if (index == 0)
         {
          <td rowspan="@branddata.MonthCarModelSales.Count()">@branddata.CarBrand.Name</td>
         }
          <td>
            @m.CarModel.Name
            <input type="hidden" value="@m.CarModelId" name="rows[@(i)].CarModelId" />
           <input type="hidden" name="rows[@(i)].Month" value="@Model.MonthCarSale.CurrentDate.ToString("yyyy-MM-01")" />     
           @if(m.Id!=0){              
            <input type="hidden" value="@m.Id" name="rows[@(i)].Id" />              
          }     
          </td>
          <td></td>
          <td><input type="text" name="rows[@(i)].YCKC" value="@m.YCKC" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].SYJC" value="@m.SYJC" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].SYWJ" value="@m.SYWJ" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].YDEW" value="@m.YDEW" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].YDBD" value="@m.YDBD" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].AKC" value="@m.AKC" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].BKC" value="@m.BKC" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].CKC" value="@m.CKC" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].CKL" value="@m.CKL" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].BYYT" value="@m.BYYT" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].YJEW" value="@m.YJEW" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].YJBD" value="@m.YJBD" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].XSMB" value="@m.XSMB" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].HYWKH" value="@m.HYWKH" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].AYWKH" value="@m.AYWKH" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].BYWKH" value="@m.BYWKH" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].HDJKH" value="@m.HDJKH" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].ADJKH" value="@m.ADJKH" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].BDJKH" value="@m.BDJKH" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].AJZC" value="@m.AJZC" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].BJZC" value="@m.BJZC" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].CJZC" value="@m.CJZC" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].OJZC" value="@m.OJZC" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].BXMB" value="@m.BXMB" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].ZHMB" value="@m.ZHMB" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].JRMB" value="@m.JRMB" class="w20 ipt" /></td>
          <td><input type="text" name="rows[@(i)].YBMB" value="@m.YBMB" class="w20 ipt" /></td>
         </tr>
     
          index++; i++;
     }
 }
 


 

</tbody></table>
</div>
<div class="formBar" ratio="#30">
			<ul>
                <li><div class="simplebutton"><div class="r"><button type="button" class="submit">保存</button></div></div></li>	
			</ul>
</div>
</form>
</div>